package com.ruoyi.house.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.house.mapper.HseHouseMapper;
import com.ruoyi.house.domain.HseHouse;
import com.ruoyi.house.service.IHseHouseService;

/**
 * 房源Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-08
 */
@Service
public class HseHouseServiceImpl implements IHseHouseService 
{
    @Autowired
    private HseHouseMapper hseHouseMapper;

    /**
     * 查询房源
     * 
     * @param id 房源主键
     * @return 房源
     */
    @Override
    public HseHouse selectHseHouseById(Long id)
    {
        return hseHouseMapper.selectHseHouseById(id);
    }

    /**
     * 查询房源列表
     * 
     * @param hseHouse 房源
     * @return 房源
     */
    @Override
    public List<HseHouse> selectHseHouseList(HseHouse hseHouse)
    {
        return hseHouseMapper.selectHseHouseList(hseHouse);
    }

    /**
     * 新增房源
     * 
     * @param hseHouse 房源
     * @return 结果
     */
    @Override
    public int insertHseHouse(HseHouse hseHouse)
    {
        hseHouse.setCreateTime(DateUtils.getNowDate());
        return hseHouseMapper.insertHseHouse(hseHouse);
    }

    /**
     * 修改房源
     * 
     * @param hseHouse 房源
     * @return 结果
     */
    @Override
    public int updateHseHouse(HseHouse hseHouse)
    {
        hseHouse.setUpdateTime(DateUtils.getNowDate());
        return hseHouseMapper.updateHseHouse(hseHouse);
    }

    /**
     * 批量删除房源
     * 
     * @param ids 需要删除的房源主键
     * @return 结果
     */
    @Override
    public int deleteHseHouseByIds(Long[] ids)
    {
        return hseHouseMapper.deleteHseHouseByIds(ids);
    }

    /**
     * 删除房源信息
     * 
     * @param id 房源主键
     * @return 结果
     */
    @Override
    public int deleteHseHouseById(Long id)
    {
        return hseHouseMapper.deleteHseHouseById(id);
    }
}
